package com.tvunetworks.center.user.service;

import com.tvunetworks.center.common.model.LoginUser;
import com.tvunetworks.center.common.model.UserBehavior;
import com.tvunetworks.center.common.util.Result;
import com.tvunetworks.center.user.model.param.UserOperationParam;

import java.util.List;
import java.util.Map;
/**
 * @author Etan Yang
 * @data: 2021/4/9 16:34
 * @program: tvucc-aggregator
 * @description:
 */
public interface UserBehaviorService {
    /**
     *
     * @param userBehavior userBehavior
     */
    void setUserBehavior(UserBehavior userBehavior);

    /**
     * 获取单个user behavior
     *
     * 81000302: Not unique user behavior
     *
     * @param userBehavior userBehavior
     * @return Result
     */
    Result<String> getUserBehavior(UserBehavior userBehavior);


    /**
     *
     * 一次获取多个 user behavior，相对于单个的区别在于多个 remark 用逗号区分
     *
     * @param userBehavior userBehavior
     * @return Map<remark,content>
     */
    Result<Map<String,String>> getUserBehaviors(UserBehavior userBehavior);

    /**
     *
     * @param userId userId
     * @param pn pn
     * @return UserBehavior
     * @throws Exception 编译异常
     */
    UserBehavior userBehavior(String userId, String pn) throws  Exception;

    /**
     *
     * @param userBehavior userBehavior
     * @throws Exception void
     */
    void updataUserBehavior(UserBehavior userBehavior) throws Exception;

    /**
     *
     * @param userBehavior userBehavior
     * @return UserBehavior
     * @throws Exception  编译异常
     */
    UserBehavior queryUserBehavior(UserBehavior userBehavior) throws Exception;

    /**
     * 查询 queryUserBehaviorList
     * @param userId userId
     * @param pn pn
     * @param sort 排序规则
     * @return Map
     * @throws Exception 编译异常
     */
     Map queryUserBehaviorList(String userId, String pn,String sort) throws Exception;

    /**
     *
     * @param rid rid
     * @param sourceTypeList void
     */
     void setRSourceListToRedis(String rid,String sourceTypeList) ;

    /**
     *
     * @param rid rid
     * @return String
     */
     String getRSourceListToRedis(String rid) ;

    /**
     *
     * @param userBehavior userBehavior
     * @return List
     */
    List<UserBehavior> userBehaviorList(UserBehavior userBehavior);

    /**
     *
     * @param userOperationParam userOperationParam
     * @param user user
     * @return Result
     * @throws Exception 编译
     */
    Result<String> listUserOperation(UserOperationParam userOperationParam, LoginUser user) throws Exception;

    /**
     *
     * @param userOperationParam userOperationParam
     * @param user user
     * @return Result
     * @throws Exception 编译
     */
    Result<String> listUserEmail(UserOperationParam userOperationParam,LoginUser user) throws Exception;


}
